package zqm.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class FileResourceConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 绝对路径写法，适配你的项目目录
        registry.addResourceHandler("/file/**")
                .addResourceLocations("file:E:/JAVA2023/SpringCloud的美食论坛/icooking/icooking_cloud/college_serve/files/");
    }
} 